<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        table{
            border-collapse: collapse; font-size: 14px; width: 80%; margin: auto;
        }
        table, th, td{
            border: 1px solid darkslategray; padding: 10px;
        }
    </style>
</head>
<body>
<div style="text-align: center">
    <span>在线人数：<span th:text="${count}"></span></span>
    <span style="font-size: 30px; color: darkslategray; margin-left: 200px">交大理工学生名单</span>
    <span style="margin-left: 120px">欢迎：<span th:text="${name}"></span></span>
    <a th:href="@{/logout}" style="margin-left: 80px">注销</a>
    <hr/>
    <a href="" th:href="@{/add}">添加学生信息</a>
    <a href="" th:href="@{/cj}">成绩查询</a>
    <table>
        <tr>
            <th>id</th>
            <th>名字</th>
            <th>年龄</th>
            <th>性别</th>
            <th>操作</th>
        </tr>
        <tr th:each="user:${users}">
            <td th:text="${user.id}"></td>
            <td th:text="${user.name}"></td>
            <td th:text="${user.age}"></td>
            <td th:text="${user.gender}"></td>
            <td>
                <a href="" th:href="@{/update(id=${user.id})}">编辑</a>
                <a href="" th:href="@{/del(id=${user.id})}">删除</a>
            </td>
        </tr>
    </table>
    <p>
        <a href="" th:href="@{/page(number=${pageNum - 1})}">上一页</a>
        <a href="" th:href="@{/page(number=${1})}">1</a>
        <a href="" th:href="@{/page(number=${2})}">2</a>
        <a href="" th:href="@{/page(number=${3})}">3</a>
        <a href="" th:href="@{/page(number=${pageNum+1})}">下一页</a>
    </p>
</div>
</body>
</html>